/**
 * This File shows how to put your window just in the middle of the screen.
 */

package GUITest;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

public class FrameTest2 {
	
	public static void main(String args[]) {
		JFrame theFrame = new JFrame("Wheee!!!");
		theFrame.setSize(200, 200);
		
		Dimension frameSize = theFrame.getSize();
		
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		
		int centerX = screenSize.width/2;
		int centerY = screenSize.height/2;
		
		int halfWidth = frameSize.width/2;
		int halfHeight = frameSize.height/2;
		theFrame.setLocation(centerX-halfHeight, centerY - halfHeight);
		
		theFrame.setVisible(true);
	}

}
